<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<#include "/views/ftl/base/manager_include.ftl">
<script type="text/javascript" src="${basePath}js/My97DatePicker/WdatePicker.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户列表</title>
<script type="text/javascript">
$().ready(function() {
	$("#search_button").click(function(){
		$('#select_form').submit();
    });
    
     $('#function_user_button').click(function(){
     var userId=$("input[name=userId]").val();
      if(userId==""){
       alert("请填写用户id");return;
       }
      window.location.href=base+"manager/UserFunctionBlack_saveUserFunctionBackUI?userId="+userId; 
     
    
    });
     $('#function_message_button').click(function(){
     var userId=$("input[name=userId]").val();
       if(userId==""){
       alert("请填写用户id");return;
       }
      window.location.href=base+"manager/SystemMessage_saveSystemMessageUI?receiveUserId="+userId; 

    });
    $('#add_user_button').click(function(){
    	$.ajax({
			type : 'post',
			url:base+"manager/User_createNoLiveUserPage",
			dataType : "json",
			data : {
			},
			success : function(data) {
				if(data.code==1){
			   	 	 window.location.href=base+"manager/User_userInfo?userId="+data.data.id; 
				}
				if(data.code==0){
					alert(data.msg);
				}
			}
		});
    	
    });
    
    
});
function setEnable(id,enable){
	var msg="确定禁用"+id+"吗？";
	if(enable==1){
		msg = "确定恢复"+id+"吗？";
	}
   if(confirm(msg))
   {
    $.ajax({
		type : 'post',
		url:base+"manager/User_setEnable",
		dataType : "json",
		data : {userId:id,enable:enable},
		success : function(data) {
			if(data.code==1){
			    alert("操作成功！");
				$("#pagerForm").submit();
			}
			if(data.code==0){
				alert(data.msg);
			}
		}
	});
	}
}
</script>
</head>
<body style="background:#eef3f7;">
<#include "/views/ftl/base/head.ftl">
<div class="Main">
  <div class="dw">
<#include "/views/ftl/base/menu.ftl">
<#function a><#return "用户列表_List"></#function> 
<!--右边内容-->
<div class="Rightbox fl">
    <!--导航-->
    <div class="Bread_crbs clear">
      <div class="Bread_crbs_img fl"></div>
      <div class="Bread_crbs_text fl">
      	<a href="javascript:void(0);"><span>用户管理</span></a>
      	<span class="fnt_famy">></span>
      	<a href="javascript:void(0);"><span>用户列表</span></a>
      </div>
    </div>
    <!--搜索框修改-->
    <form id="select_form" name="select_form" action="${basePath}manager/User_userList" method="post">
	    <div class="searchBox fl">
	        <!--<span>用户ID</span><input type="text" name="userId" value="${(userId?c)!''}" />-->
	        <span>用户名</span><input type="text" name="userName" value="${(userName)!''}" />
	        <span>注册时间</span><input type="text" name="startDate" value="${(startDate)!''}" readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
	   		<select name="isEnable" id="isEnable" class="sp" style="display:none;">
          		<option value="2" <#if isEnable??><#if isEnable==2>selected='true'</#if></#if>>全部</option>
          	 	<option value="1" <#if isEnable??><#if isEnable==1>selected='true'</#if></#if>>可用</option>
          		<option value="0" <#if isEnable??><#if isEnable==0>selected='true'</#if></#if>>禁用</option> 
          	</select>
	    </div>
    </form>
	    <a href="javascript:void(0);" id="search_button" class="search_btn fl"><span>搜索</span></a> 
		<!--
		<a href="javascript:void(0);" id="function_user_button" style="width:80px" class="search_btn fl "><span>功能限制</span></a>
		<a href="javascript:void(0);" id="function_message_button" style="width:89px;background: #00ad55 none repeat scroll 0 0;" class="search_btn fl "><span>发送系统消息</span></a>
		-->
    <div class="clear"></div>
    <!--表格列表-->
    <div class="Table">
      <table id="table" cellpadding="0" cellspacing="1">
        <tbody>
          <tr id="gl">
            <td>ID</td>
            <td>用户名</td> 
			<td>真实姓名(公司名)</td>
			<td>手机号</td> 
			<td>QQ号</td>
			<td>Email</td>
			<td>钱包余额</td>
			<td>注册时间</td>
            <td>状态</td>
            <td>操作</td>
          </tr>
         <#if (pager.list??)> 
         <#if ((pager.list?size)>0)>
          <#list pager.list as bean>
          <tr>
            <td>${(bean.id?c)}</td>
            <td>${(bean.userName)!''}</td> 
            <td >${(bean.realName)!''}</td>
            <td>${(bean.phoneNum)!''}</td> 
            <td>${(bean.qqNum)!''}</td>
            <td>${(bean.email)!''}</td>
           <td>${(bean.wallet)!''}</td> 
            <td>${(bean.registTime)!''}</td>
            <td class="tdd50">
            <#list accountStatusTypeEnum as enum>
            	<#if bean.accountStatus==enum.accountStatus>${enum.description}</#if>
            </#list> 
            <td class="tbl_btn tdd150">
         		<a href="${basePath}manager/User_userInfo?userId=${(bean.id?c)}"><span id="editor">详情</span></a> 
         		<a href="${basePath}manager/UserDomain_bindDomainUI?userId=${(bean.id?c)}"><span id="green">绑定域名</span></a> 
            </td>
          </tr>
          </#list >
          </#if>
          </#if>
        </tbody>
      </table>
    </div>
    <!--翻页按钮-->
  	<#import "../../base/pager.ftl" as p>
   	<@p.pager pager = pager baseUrl = "manager/User_userList" parameterMap={"userId":(userId)!'',"userName":(userName)!'',"startDate":(startDate)!'',"isEnable":(isEnable)!''} />
</div>
</body>
</html>

